Platform Explorer / Nuxeo Platform 5.8

Component org.nuxeo.ecm.directory.sql.storage

Implementation

Class: org.nuxeo.ecm.directory.sql.SQLDirectoryDescriptor

Contributions

XML Source

<?xml version="1.0"?>

<component name="org.nuxeo.ecm.directory.sql.storage">

  <implementation class="org.nuxeo.ecm.directory.sql.SQLDirectoryDescriptor" />

  <require>org.nuxeo.ecm.directory.sql.SQLDirectoryFactory</require>

  <extension target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory"
    point="directories">

    <directory name="userDirectory">

      <schema>user</schema>

      <dataSource>jdbc/nxsqldirectory</dataSource>

      <table>users</table>
      <idField>username</idField>
      <passwordField>password</passwordField>
      <passwordHashAlgorithm>SSHA</passwordHashAlgorithm>
      <autoincrementIdField>false</autoincrementIdField>
      <computeMultiTenantId>false</computeMultiTenantId>
      <dataFile>users.csv</dataFile>
      <createTablePolicy>on_missing_columns</createTablePolicy>
      <querySizeLimit>50</querySizeLimit>

      <references>
        <inverseReference field="groups" directory="groupDirectory"
          dualReferenceField="members" />
      </references>

    </directory>

    <directory name="groupDirectory">

      <schema>group</schema>
      <dataSource>jdbc/nxsqldirectory</dataSource>
      <table>groups</table>
      <idField>groupname</idField>
      <dataFile>groups.csv</dataFile>
      <createTablePolicy>on_missing_columns</createTablePolicy>
      <autoincrementIdField>false</autoincrementIdField>

      <!-- Add 10 min cache to avoid refetching the groups during login --> 
      <cacheTimeout>360</cacheTimeout>
      <cacheMaxSize>1000</cacheMaxSize>

      <references>
        <tableReference field="members" directory="userDirectory"
          table="user2group" sourceColumn="groupId" targetColumn="userId" schema="user2group" 
          dataFile="user2group.csv" />
        <!-- Warning ! From Nuxeo 5.3.1, a wrong setting has been fixed. See
        http://jira.nuxeo.org/browse/NXP-4401 . Nuxeo upgrades would need a fix in the
        database (inverting parentGroupId and childGroupId in the group2group)  -->
        <tableReference field="subGroups" directory="groupDirectory"
          table="group2group" sourceColumn="parentGroupId" 
          targetColumn="childGroupId" schema="group2group" />
        <inverseReference field="parentGroups" directory="groupDirectory"
          dualReferenceField="subGroups" />
      </references>

    </directory>

  </extension>
</component>